using System;
using System.Collections.Generic;
using System.Text;

namespace Decav.Gatsb.Application.CommandInterpreters
{
    /// <summary>
    /// Authenticates a user using the mobile message against the <see cref="GatsbApplication"/>, creating
    /// a new instance for the user.
    /// </summary>
    public class AuthenticationCommandInterpreter : ICommandInterpreter
    {
        #region ICommandInterpreter Members

        public void Execute(CommandInterpreterContext context)
        {
            GatsbServiceApplication.CreateNewThreadApplication(context.InputMessage.SendingPhoneNumber, context.InputMessage.SendingAddress);
            context.InputMessage.SendingPhoneNumber = GatsbApplication.Current.CurrentUser.MobilePhoneNumber;
        }

        #endregion
    }
}
